package com.digital.welcome.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.digital.welcome.entity.Role;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;
import org.springframework.stereotype.Repository;

import java.util.Set;

/**
 * @author 韩
 */
@Mapper
@Repository
public interface RoleMapper extends BaseMapper<Role> {

    Set<String> selectAllRoleNamesByUsername(String username);

    int update(String userName, Integer roleId);

    @Select("select role_id from user_role where user_name=#{UserName}")
    int selectRoleIdByUserName(String UserName);
}
